/*
 *
 *      Copyright (c) 2018-2025, waterx All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: waterx
 *
 */

package com.example.tenant.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.tenant.Converter.CustomStringConverter;
import com.example.tenant.Converter.LongStringConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * <p>
 * 角色表
 * </p>
 *
 * @author waterx
 * @since 2017-10-29
 */
@Data
@ColumnWidth(10)
@EqualsAndHashCode(callSuper = true)
public class SysRole extends Model<SysRole> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "role_id", type = IdType.ASSIGN_ID)
    @ExcelProperty("role_id")
    private String roleId;

    @ExcelProperty("role_name")
    private String roleName;

    @ExcelProperty("role_code")
    private String roleCode;

    @ExcelProperty("role_desc")
    private String roleDesc;

    @ExcelProperty("ds_type")
    private Integer dsType;

    @ExcelProperty("client_id")
    private String clientId;

    /**
     * 数据权限作用范围
     */
    @ExcelProperty("ds_scope")
    private String dsScope;

    /**
     * 所属部门id
     */
    @ExcelProperty("dept_id")
    private String deptId;

    /**
     * 备注
     */
    @ExcelProperty("remark")
    private String remark;

    /**
     * 角色类型，1普通角色2系统管理员3安全管理员4 审计管理员
     */
    @ExcelProperty("role_type")
    private String roleType;

    /**
     * 数据标签
     */
    @ExcelProperty("data_flag")
    private String dataFlag;

    /**
     * 排序号
     */
    @ExcelProperty("order_num")
    private Integer orderNum;

    /**
     * 创建人
     */
    @ExcelProperty(value = "create_by", converter = CustomStringConverter.class)
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     */
    @ExcelProperty("create_time")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty(value = "update_by", converter = CustomStringConverter.class)
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty("update_time")
    private Date updateTime;

    /**
     * 删除标记
     */
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty("del_flag")
    private String delFlag;

    /**
     * 租户id
     */
    @ExcelProperty(value = "tenant_id", converter = LongStringConverter.class)
    private Long tenantId;

}
